package com.ruoyi.cms.service.impl;

import com.ruoyi.cms.domain.Theme;
import com.ruoyi.cms.mapper.ThemeMapper;
import com.ruoyi.cms.service.ThemeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 主题
 * @author 王俊南
 *
 */
@Service
public class ThemeServiceImpl implements ThemeService {

	@Autowired
	private ThemeMapper themeMapper;

	@Override
	public List<Theme> queryListByPage(Theme params) {
		List<Theme> list = themeMapper.queryListByPage(params);
		return list;
	}

	@Override
	public int save(Theme theme) {
		return themeMapper.insert(theme);
	}

	@Override
	public int update(Theme theme) {
		return themeMapper.updateById(theme);
	}

	@Override
	public int batchUpdateStatus(Map<String,Object> params) {
		return themeMapper.batchUpdateStatus(params);
	}

	@Override
	public int delete(String id) {
		return themeMapper.deleteById(id);
	}

	@Override
	public List<Theme> queryByPathName(String themePath) {
		return themeMapper.queryByPathName(themePath);
	}

	@Override
	public Theme getCurrentTheme() {
		return themeMapper.getCurrentTheme();
	}

}
